package com.sevenit.nj.yrmtfish.entity;

import com.amap.api.location.AMapLocation;

/**
 * LocationData entity. 
 * @author wangxw
 */
public class LocationData  implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	
	//---------------------指令-------------------------
	//是否开始定位.
	private boolean bDoWork;
	//本次定位时长（单位：秒，如果想一直处于定位状态，设置为-1）.
	private long lWorkTime;
	//定位刷新时间（单位：秒,最小值为5）.
	private int iReFreshTime;
	//是否包含使用GPS定位.
	private boolean bUseGps;
	
	//---------------------状态-------------------------
	//是否正在定位状态.
	private boolean bWorking;
	//是否有位置信息.
	private boolean bLocExsit;
	//开始定位时间(系统时间).
	private long timeStart;
	//更新时间(系统时间).
	private long timeUpd;
	
	//---------------------数据-------------------------
	//定位方式.
	private String provider;
	//UTC时间(GPS时间).
	private long timeUtc;
	//精度（米）.
	private double accuracy;
	//偏离正北方的度数.
	private double bear;
	//维度.
	private double gpslat;
	//经度 .
	private double gpslng;
	//速度 .
	private double speed;
	//海拔.
	private double altitude;
	//位置描述
	private String desc;
	//省.
	private String province;
	//市.
	private String city;
	//区(县).
	private String district;
	//城市编码.
	private String cityCode;
	//区域编码.
	private String adCode;
	//高德地图的位置对象.
	private AMapLocation aLocation;
	
	/**
	 * 
	 */
    public LocationData() {
    	clear();
    }
    
    /**
     * 重置数据.
     */
    public void clear() {
    	
    	bDoWork = false;
    	lWorkTime = 60;
    	iReFreshTime = 30;
    	bUseGps = true;
    	
    	bWorking =false;
    	bLocExsit = false;
    	timeStart = 0;
    	timeUpd = 0;
    	
    	provider = "";
    	timeUtc = 0;
    	accuracy = 0;
    	bear = 0;
    	gpslat = 0;
    	gpslng = 0;
    	speed = 0;
    	altitude = 0;
    	desc = "";
    	province = "";
    	city = "";
    	district = "";
    	cityCode = "";
    	adCode = "";
    	//=====================
    	//gpslng = 118.77789599;
    	//gpslat = 32.08961595;
    	//=====================
    }
    
    /**
     * 设定开始定位指令.
     * @param workTime
     * @param reFreshTime
     * @param useGps
     */
	public void startWork(long workTime, int reFreshTime, boolean useGps) {
		
		if(this.bWorking){
			return;
		}
		
		this.lWorkTime = workTime;
		this.iReFreshTime = reFreshTime;
		this.bUseGps = useGps;
		this.bDoWork = true;
	}
	
    /**
     * 设定结束定位指令.
     */
	public void stopWork() {
		this.bDoWork = false;
	}
	
    //===============get & set==================

	public String getProvider() {
		return provider;
	}

	public long getTimeStart() {
		return timeStart;
	}

	public void setTimeStart(long timeStart) {
		this.timeStart = timeStart;
	}

	public boolean isbDoWork() {
		return bDoWork;
	}

	public void setbDoWork(boolean bDoWork) {
		this.bDoWork = bDoWork;
	}

	public long getlWorkTime() {
		return lWorkTime;
	}

	//使用startWork设定，不能分开设定
//	public void setlWorkTime(long lWorkTime) {
//		this.lWorkTime = lWorkTime;
//	}
//	public void setiReFreshTime(int iReFreshTime) {
//		this.iReFreshTime = iReFreshTime;
//	}
//	public void setbUseGps(boolean bUseGps) {
//		this.bUseGps = bUseGps;
//	}
	
	public int getiReFreshTime() {
		return iReFreshTime;
	}

	public boolean isbUseGps() {
		return bUseGps;
	}

	public boolean isbWorking() {
		return bWorking;
	}

	public void setbWorking(boolean bWorking) {
		this.bWorking = bWorking;
	}

	public boolean isbLocExsit() {
		return bLocExsit;
	}

	public void setbLocExsit(boolean bLocExsit) {
		this.bLocExsit = bLocExsit;
	}

	public long getTimeUpd() {
		return timeUpd;
	}

	public void setTimeUpd(long timeUpd) {
		this.timeUpd = timeUpd;
	}

	public void setProvider(String provider) {
		this.provider = provider;
	}

	public long getTimeUtc() {
		return timeUtc;
	}

	public void setTimeUtc(long timeUtc) {
		this.timeUtc = timeUtc;
	}

	public double getAccuracy() {
		return accuracy;
	}

	public void setAccuracy(double accuracy) {
		this.accuracy = accuracy;
	}

	public double getBear() {
		return bear;
	}

	public void setBear(double bear) {
		this.bear = bear;
	}

	public double getGpslat() {
		return gpslat;
	}

	public void setGpslat(double gpslat) {
		this.gpslat = gpslat;
	}

	public double getGpslng() {
		return gpslng;
	}

	public void setGpslng(double gpslng) {
		this.gpslng = gpslng;
	}

	public double getSpeed() {
		return speed;
	}

	public void setSpeed(double speed) {
		this.speed = speed;
	}

	public double getAltitude() {
		return altitude;
	}

	public void setAltitude(double altitude) {
		this.altitude = altitude;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getCityCode() {
		return cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}

	public String getAdCode() {
		return adCode;
	}

	public void setAdCode(String adCode) {
		this.adCode = adCode;
	}

	
	public AMapLocation getaLocation() {
		return aLocation;
	}

	public void setaLocation(AMapLocation aLocation) {
		this.aLocation = aLocation;
	}
	
	
	//===============get & set==================
}